<?php

class JProjectSelector extends CInputWidget {
	public function run(){
		$allProjects=Project::getAll();
		$data=CHtml::listData(Project::getAll(), 'id', 'name','status');
		$data=array(
			'在建'=>$data[1],
			'其它'=>$data[0]
		);
		$this->htmlOptions['empty']='';
		if($this->hasModel())
			echo CHtml::activeDropDownList($this->model,$this->attribute,$data,$this->htmlOptions);
		else
			echo CHtml::dropDownList($name,$this->value,$data,$this->htmlOptions);
	}
}